<!DOCTYPE HTML>
<html>
<body>
<canvas id="myCanvas" style="border:1px solid;" width="300" height="200"></canvas>
<script type="text/javascript">
    var c=document.getElementById("myCanvas");
    var context=c.getContext("2d");
    context.fillStyle="red";
    context.fillRect(50,25,100,100);
    context.fillStyle="green";
    context.globalCompositeOperation="source-over";
    context.beginPath();
    context.arc(150,125,50,0,Math.PI*2,true);
    context.closePath();
    context.fill();
</script>
</body>
</html>
